package com.gzy.fisherybackend.config;

import javax.annotation.PostConstruct;

import org.springframework.context.annotation.Configuration;

import lombok.extern.slf4j.Slf4j;

/**
 * Hadoop初始化配置
 * 用于解决Windows环境下缺少HADOOP_HOME环境变量的问题
 */
@Slf4j
@Configuration
public class HadoopInit {

    @PostConstruct
    public void init() {
        log.info("初始化Hadoop环境配置");
        
        // 设置hadoop.home.dir为当前目录
        System.setProperty("hadoop.home.dir", ".");
        
        // 禁用本地库加载
        System.setProperty("io.native.lib.available", "false");
        
        log.info("Hadoop环境配置初始化完成");
    }
} 